var mixin = {
  methods: {
    pushRefresh(params, deleteCurrentRouteCached) {
      if (deleteCurrentRouteCached) {
        this.$store.dispatch("tagsView/delAllCachedViews", this.$route);
      }
      this.$nextTick(() => {
        this.$router.push({
          path: "/redirect/",
          query: { refresh: true, ...params }
        });
      });
    },
    replaceRefresh(params, deleteCurrentRouteCached) {
      if (deleteCurrentRouteCached) {
        this.$store.dispatch("tagsView/delAllCachedViews", this.$route);
      }
      this.$nextTick(() => {
        this.$router.replace({
          path: "/redirect/",
          query: { refresh: true, ...params }
        });
      });
    },
    goRefresh(num) {
      let _that = this;
      let fromRoute = _that.$store.state.fromRoute;

      if (fromRoute) {
        _that.$store.dispatch("tagsView/delAllCachedViews", _that.$route);

        const { fullPath } = fromRoute;
        _that.$nextTick(() => {
          _that.$router.replace({
            path: "/redirect" + fullPath
          });
        });
      } else {
        _that.$router.go(num);
      }
    }
  }
};
export { mixin };
